#include <AVUITransform.h>
#include <AVUITransform3DCollection.h>

namespace AVUI {

class Transform3DGroup : public Transform3D
{
public:
    Transform3DGroup();
    ~Transform3DGroup() { m_children.InvalidateWeakReferences(); }


    DECLARE_ELEMENT(Transform3DGroup, Transform3D);
    IMPLEMENT_READONLY_REFERENCE_PROPERTY(Children, Transform3DCollection, true);

    Transform3DCollection* get_Children() { return &m_children; }

    virtual Matrix3D get_Value();
    virtual void CloneCore(Freezable* pSource);

    bool get_IsAffine();

    virtual void Append(Matrix3D* pMatrix) AVUI_OVERRIDE
    {
        *pMatrix = *pMatrix * get_Value();
    }

protected:
    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<Transform3DGroup>().get_Ptr(); }

private:
    Transform3DCollection m_children;
};

typedef TRefCountedPtr<Transform3DGroup> Transform3DGroupPtr;


}; // namespace AVUI
